/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cf.controller;

import com.cf.dao.impl.TbPalabraDao;
import com.cf.modelo.TbPalabra;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseId;
import org.primefaces.model.DefaultStreamedContent;
import org.primefaces.model.StreamedContent;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 *
 * @author Soltecn2
 */
@Component("ejercicioCFActualizarController")
@SessionScoped
@ManagedBean
public class EjercicioCFActualizarController implements Serializable {

    private static final long serialVersionUID = 1L;
    public String descrip = "";

    private TbPalabra palabrabean;
    private TbPalabra selectPalabra;
    public List<TbPalabra> listpalabras;
  public String showResult() {
        FacesContext fc = FacesContext.getCurrentInstance();
        Map<String, String> params = fc.getExternalContext().getRequestParameterMap();
        codigo = params.get("username");
        descrip=params.get("descr");
        return "wFrmEjercicioCFActualizar";
    }
//    public String redire() {
//
//        TbPalabraDao palabradao = new TbPalabraDao();
//        
//       // System.out.println("----------REEEE-"+selectPalabra.getImagen()+" "+selectPalabra.getImagen());
//        palabradao.actualizar(selectPalabra.getImagen(),selectPalabra.getImagen(),1,codigo.hashCode());
//        return "wFrmEjercicioCFActualizar";
//    }

    public EjercicioCFActualizarController() {

        palabrabean = new TbPalabra();
        selectPalabra = new TbPalabra();
        listpalabras=new ArrayList<TbPalabra>();
    }

    public TbPalabra getSelectPalabra() {
        return selectPalabra;
    }

    public void setSelectPalabra(TbPalabra selectPalabra) {
        this.selectPalabra = selectPalabra;
    }

    public TbPalabra getPalabrabean() {
        return palabrabean;
    }

    public void setPalabrabean(TbPalabra palabrabean) {
        this.palabrabean = palabrabean;
    }

//    public String RealizarBusqueda() {
//
//        listpalabras = TbPalabraDao.listPalabras(palabrabean);
//
//        return null;
//    }
//
//    public List<TbPalabra> getListpalabras() {
//        listpalabras = TbPalabraDao.listPalabras(palabrabean);
//        return listpalabras;
//    }

    public void setListpalabras(List<TbPalabra> listpalabras) {
        this.listpalabras = listpalabras;
    }


    public String getDescrip() {
        return descrip;
    }

    public void setDescrip(String descrip) {
        this.descrip = descrip;
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }
    public String codigo;

  
    
    
    
    
    
    
    
    
}
